Skip to content

Enable the index refresh block#135785

Merged
benchaplin merged 24 commits intoelastic:mainfrom
benchaplin:enable_index_refresh_block
Mar 16, 2026
Merged

Enable the index refresh block#135785
benchaplin merged 24 commits intoelastic:mainfrom
benchaplin:enable_index_refresh_block

Conversation

@benchaplin
Copy link
Copy Markdown
Contributor

@benchaplin benchaplin commented Oct 1, 2025

All changes have been made to skip indices with this block during searches (#129132). This block can now be enabled by default.

Edit: This required adjusting some yml tests. These tests would fail in Serverless as the presence of a refresh block made them skip the index during a search (the intended behavior of a refresh block). We fix this by adding a refresh on each index, which will prevent the test from proceeding until the refresh block is gone.

@benchaplin benchaplin added >non-issue Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations labels Oct 1, 2025
@elasticsearchmachine elasticsearchmachine added serverless-linked Added by automation, don't add manually v9.2.0 labels Oct 1, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

Copy link
Copy Markdown
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@fcofdez fcofdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I wonder why we need the extra refreshes though.


- do:
indices.refresh:
index: test_nonexistent
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test creates an empty index with a mapping and allow_unmapped_fields: false, then immediately searches the index with a non-existent field and expects a 400 error. When run in ServerlessClientYamlTestSuiteIT with the refresh block, the search occurs when the refresh block is still on the index, and the index is skipped, leading to a 200 on 0 shards. Adding this refresh makes the test wait for the block to be gone before making the search call.

Does that make sense? I thought about just blacklisting these tests for Serverless but figured this is a better solution. Curious if you agree...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me 👍

@benchaplin benchaplin merged commit f718874 into elastic:main Mar 16, 2026
36 checks passed
michalborek pushed a commit to michalborek/elasticsearch that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Search Foundations/Search Catch all for Search Foundations serverless-linked Added by automation, don't add manually Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants